﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
    <body>
        <input type="file" id="testControl"/>
        <button onclick="test()">ưerwerwerwer</button>
    </body>
    
    <script language="javascript" type="text/javascript">
        function test() {
            alert("sfsfsffd");
            var strFileName = document.getElementById("testControl").value;
            var objFSO = new ActiveXObject("Scripting.FileSystemObject");
            var e = objFSO.getFile(strFileName);
            var fileSize = e.size;
            alert(fileSize);
            if (fileSize > 2097152) {
                alert('size more than 2MB');
            }    
        }
    </script>
</html>
